package com.fhz.mvvmshopjava.ui.sell;

import androidx.lifecycle.LiveData;

import com.fhz.mvvmshopjava.api.ServiceApi;
import com.fhz.mvvmshopjava.core.BaseDataSource;
import com.fhz.mvvmshopjava.entity.Goods;
import com.fhz.mvvmshopjava.entity.Order;
import com.fhz.mvvmshopjava.utils.RetrofitManger;
import com.fhz.utilsfhz.ApiResponse;

import javax.inject.Inject;

/**
 * 时间:2022/6/8
 *
 * @author msfeng
 * 简述: TODO
 */
public class SellDataSource extends BaseDataSource {
    @Inject
    public SellDataSource() {
    }
    public LiveData<ApiResponse<Goods>> getGoods(String id){
        return RetrofitManger.getInstance().getRetrofit().create(ServiceApi.class).getGoods(id);
    }

    public LiveData<ApiResponse<Order>> addOrder(Order order){
        return RetrofitManger.getInstance().getRetrofit().create(ServiceApi.class).addOrder(order);
    }
}

